<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page isELIgnored="false" %>
    <c:set var="code" value="${code}"/>
    <c:set var="account" value="${account}"/>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/login.css">


<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.backstretch.min.js"></script>

</head>
<body style="background-image: url(image/1.jpg)">


	<div class="container-fluid">
		<div class="row">
			<div class="row clearfix">
				<div class="col-md-12 column">
					<nav class="navbar navbar-default navbar-static-top"
						role="navigation">
						<div class="navbar-header">
							<ul class="nav nav-tabs ">
								<li><img src="image/~F$UI6VM26N2K%7B)M(%60%5BX%5DFI.jpg"
									style="height: 45px; width: auto; margin-top: 5px"></li>
								<li><p
										style="font-family: 华文彩云; font-size: 35px; margin-top: 3px">毕业生就业管理</p></li>
							</ul>
						</div>

						<ul class="nav nav-tabs ">

							<li class="dropdown pull-right"><a href="#"
								data-toggle="dropdown" class="dropdown-toggle">个人中心<strong
									class="caret"></strong></a>
								<ul class="dropdown-menu">
									<li><a href="#">修改信息</a></li>
									<li><a href="#">个人关注</a></li>
									<li><a href="#">更多设置</a></li>

								</ul></li>
							<form class="navbar-form navbar-left pull-right" role="search">
								<div class="form-group">
									<input type="text" class="form-control" placeholder="Search">
								</div>
								<button type="submit" class="btn btn-default">提交</button>
							</form>
						</ul>
					</nav>
				</div>
			</div>
			<div class="col-md-offset-3 col-md-6">
				<form class="form-horizontal" id="login">
					<span class="heading">用户登录</span>
					<div class="form-group">
						<input type="text" class="form-control" id="account" name="account"
							placeholder="用户名或电子邮件"> <i class="fa fa-user"></i>
							<p id="msg">
					</div>
					<div class="form-group help">
						<input type="password" class="form-control" id="password" name="password"
							placeholder="密　码"> <i class="fa fa-lock"></i> <a href="#"
							class="fa fa-question-circle"></a>
					</div>	
					<div class="form-group">	
						<input type="text" class="form-control" id="code" name="code"
							placeholder="验证码"> <br /> 
							<img id="img" src="user/check.jpg" onclick="refresh()"> <i
							class="fa fa-user"></i>
					</div>

					<div class="form-group">
						<div class="main-checkbox">
							<input type="checkbox" value="None" id="checkbox1" name="check" />
							<label for="checkbox1"></label>
						</div>

						<span class="text">Remember me</span>
						<button type="button" class="btn btn-default">注册</button>
						<input id="btn-login" type="button" class="btn btn-default"  value="登录"/>

					</div>
				</form>
			</div>
		</div>
	</div>
	
	

	<script type="text/javascript">
		function refresh() {
			var url = "user/check.jpg?number=" + Math.random();
			$("#img").attr("src", url);
		}
		
	</script>
	
	<script type="text/javascript">
		$(function(){
			
			$('#btn-login').click(function(e){

				    $.ajax({
				        type: "POST",
				        url: "/GMS/login",
				        dataType:'json',
				        data: $('#login').serialize(),
				        success: function(data) {
				            result = data;
				            if (result['success'] == 2) {
				            	alert("验证码错误")
				            }
				            if (result['success'] == 1) {
				            	alert("登录成功")
				                window.location.href = "index.html"
				            }
				            if(result['success'] == 0){
				                alert("用户名密码错误！")
				            }
				        }
				    });
			});
			
			
		});
	</script>


</body>
</html>